package Twice.day11;

import java.util.LinkedList;

/**
 * @Author: lya
 * @Description: 本类的作用描述:
 * @CreateDate: 2019/8/6
 * @Version: 1.0
 */
public class LinkedListDemo {
    public static void main(String[] args) {
        //创建一个LinkedList对象
        LinkedList<String> list = new LinkedList<>();

        list.add("java");
        list.add("mysql");
        list.add("python");
        list.add("xml");

        list.addFirst("oracle");

        System.out.println(list.offerFirst("sum"));//true

        //获取头部
        System.out.println(list.getFirst());//sum

        System.out.println(list.remove());

        System.out.println(list.peekLast());//xml

        System.out.println(list.removeLast());

        System.out.println(list.getLast());
    }
}
